from django import newforms as forms
from plzkeepthat.common.constants import MAX_MAILLENGTH, MAX_NOTELENGTH
from plzkeepthat.views.forms import fields as myfields


class AddForm(forms.Form):
    """ Form for adding Notes to the database """
    text = forms.CharField(required = True, min_length = 3, max_length = MAX_NOTELENGTH, \
                           widget = forms.Textarea(attrs = {
                           'class':'addTextField',
                           'rows':'4',
                           'wrap':'virtual'
                           }))
    
    tags = myfields.TagField()

class ShareForm(forms.Form):
    """ Form for sharing notes with others """
    to = myfields.MultiEMailField()
    subject = forms.CharField(required = True, widget = forms.TextInput(attrs = {
                           'class':'subjectText'
                           }))
    text = forms.CharField(required = True, min_length = 0, max_length = MAX_MAILLENGTH, \
                           widget = forms.Textarea(attrs = {
                           'class':'shareTextField',
                           'rows':'10',
                           'wrap':'virtual'
                           }))
    